#ifndef DIALOG_SELECT_H
#define DIALOG_SELECT_H

#include <QDialog>

#include "code.h"

using std::optional;

namespace Ui {
class Dialog_select;
}

class Dialog_select : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog_select(QWidget *parent = nullptr);
    void set_selector(const Code::Selector& s);
    Code::Selector&& mov_selector() { return std::move(selector); }
    ~Dialog_select();

private slots:
    void on_attack_clicked();

    void on_defence_clicked();

    void on_add_clicked();

    void on_del_clicked();

    void on_accept_clicked();

    void on_diff_from_currentIndexChanged(int index);

    void on_accurate_clicked(bool checked);

    void on_clear_clicked();

    void on_diff_to_currentIndexChanged(int index);

private:
    Ui::Dialog_select *ui;
    Code::Selector selector;
    void read_pieces(const Code::Pieces& pieces);
};

#endif // DIALOG_SELECT_H
